///////////////////////////////////////////////////////////////////////////////
//
// lighthouse3D - 3D Software Library
//
// File: CLighting.h
//
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2003-2013 Marcus Reinhardt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
///////////////////////////////////////////////////////////////////////////////
//
// You can find a copy of the GNU General Public License (gpl.txt) in the
// directory of the library.
//
///////////////////////////////////////////////////////////////////////////////

#ifndef _CLighting_H_
#define _CLighting_H_

#include <vector>

#include "CBasicClasses.h"

///////////////////////////////////////////////////////////////////////////////
// class CLighting : Contains implementations of the lighting
///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////
// 
//  Important notice adding a dot light source
// 
//  [1]
//  Light Sources are added to the Object Space!
// 
//  The World Space Coord Sys looks the following way:
// 
//                       | y   / z
//                       |    /
//                       |   /
//                       |  /
//                       | /
//                       |/
//                       |------ x
// 
///////////////////////////////////////////////////////////////////////////////

//! Lightsource data

struct TLightSource
{
  float x, y, z;
  float xt, yt, zt;
  float ia, id, is;
  
  int lightType;
  int r,g,b;           // [0-1]
};

//! Contains the implementation of the lighting

class CLighting
{

public:

    CLighting();
    ~CLighting();

    int  getDotLightCount();
    int  getSpecularPower();
    void setAmbientLight(TLightSource l);
    void addDotLight(TLightSource &l);
    void setDotLight(int i, TLightSource &l);
    void setTransformedDotLight(int i, TLightSource &l);
    void setSpecularPower(int i);
    
    TLightSource *getAmbientLight();
    TLightSource *getDotLight(int i);

private:

    int                  specPower;

    TLightSource         ambientLight;
	std::vector<TLightSource> dotLights;
};

#endif
